home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 23 code / Multipane Dialogs Code / Utilities.h < prev   
Encoding:
Text File  |  1995-04-18  |  2.7 KB  |  84 lines  |  [TEXT/MMCC]

  1. // Required headers.
  2. #ifndef __DIALOGS__
  3. #include <Dialogs.h>
  4. #endif
  5.  
  6. #ifndef __TOOLUTILS__
  7. #include <ToolUtils.h>
  8. #endif
  9.  
  10. #ifndef __PROCESSES__
  11. #include <Processes.h>
  12. #endif
  13.  
  14. #ifndef __FONTS__
  15. #include <Fonts.h>
  16. #endif
  17.  
  18. #ifndef __APPLEEVENTS__
  19. #include <AppleEvents.h>
  20. #endif
  21.  
  22. #ifndef __RESOURCES__
  23. #include <Resources.h>
  24. #endif
  25.  
  26. #ifndef __GESTALT__
  27. #include <Gestalt.h>
  28. #endif
  29.  
  30. #ifndef __TRAPS__
  31. #include <Traps.h>
  32. #endif
  33.  
  34. // ----------------------------------------------------------------------------------
  35. #define kCntlActivate            0            /* enabled control’s hilite state */
  36. #define kCntlDeactivate            0xFF        /* disabled control’s hilite state */
  37. #define kButtonFrameSize        3            /* button frame’s pen size */
  38. #define kButtonFrameInset        (-4)        /* inset rectangle adjustment around button */
  39.  
  40. extern short    gQDVersion;                /* major QD version #; 0 for original,
  41.                                             1 for color QD, 2 for 32-bit QD */
  42. extern short gInitMPDUtils;
  43.  
  44. // ******************** Dialog & Window
  45. Boolean GetCheckOrRadio(DialogPtr dlgPtr, short itemNo);
  46. void ToggleCheck(DialogPtr dlgPtr, short chkItem);
  47. void SetCheckOrRadioButton(DialogPtr dlgPtr, short itemNo, short state);
  48. void OutlineDialogItem(DialogPtr dlgPtr, short item);
  49. void OutlineControl(ControlHandle button);
  50. DialogPtr GetCenteredDialog(short id, DialogPtr storage, WindowPtr relatedWindow, WindowPtr behind);
  51. Rect CenterWindow(WindowPtr window, WindowPtr relatedWindow, Rect sizeInfo);
  52. OSErr SimpleCanDialog(void);
  53. void UseControlStyle(ControlHandle ctl);
  54. void DoDraw1Control(ControlHandle ctl, Boolean scrollBarsOnly);
  55. void ShowStyledControl(ControlHandle ctl);
  56. Boolean IsScrollBar(ControlHandle ctl);
  57. short GetButtonVariant(ControlHandle ctl);
  58. Boolean GetControlStyle(ControlHandle ctl, void *cinfo);
  59. Boolean WhichControl(Point mouseLoc, long when, WindowPtr window, ControlHandle *ctlHit);
  60.  
  61. // ******************** Rectangle & Point
  62. Rect GetWindowContentRect(WindowPtr window);
  63. Rect GetWindowStructureRect(WindowPtr window);
  64. Point GetGlobalTopLeft(WindowPtr window);
  65. void LocalToGlobalRect(Rect *aRect);
  66. void PositionRectInRect(Rect outerRect, Rect *innerRect, Fixed horzRatio, Fixed vertRatio);
  67.  
  68. // ******************** Miscelaneous
  69. char LockHandleHigh(Handle theHandle);
  70. short GetHexByte(char *cptr);
  71. Handle GetAppResource(ResType theType, short theID, OSErr *err);
  72. Boolean    TrapExists(short theTrap);
  73. short NumToolboxTraps(void);
  74. TrapType GetTrapType(short theTrap);
  75. void InitMPDUtils(void);
  76.  
  77. // ******************** Window Centering Support
  78. Rect GetWindowDeviceRectNMB(WindowPtr window);
  79. Rect GetWindowDeviceRect(WindowPtr window);
  80. Rect GetMainScreenRect(void);
  81. GDHandle GetRectDevice(Rect globalRect);
  82. RgnHandle LocalScreenDepthRegion(short depth);
  83. RgnHandle ScreenDepthRegion(short depth);
  84.